﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Budget_LoadingFile.aspx.cs" Inherits="ConsolidationTool.WebParts.Layouts.ConsolidationTool.WebParts.Budget_LoadingFile" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <style type="text/css">
        .commontable{width:98%;border-collapse:collapse; font-size:12px;}
        .commontable input[type=text],.fs-common-selector input[type=text]{width:95%; text-align:right;}
        .commontable td[identity]{text-align:right;}
        .commontable td{border:1px solid #ccc;min-height:20px;padding:.3em;}
        .commontable td.success{ font-weight:bold; background-color:Green; color:White;}
        .commontable td.fail{ font-weight:bold; background-color:Red; color:Yellow;}
    </style>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <h1>
    Budget P&L by customer uploading
    </h1>
    <asp:FileUpload ID="FileUpload1" runat="server" /><br />
  
    <asp:Button ID="Button1" runat="server" Text="Upload" /><br />
    <asp:Label Text="[Output]" runat="server" ID="lbOutput" /><br />
    <asp:GridView ID="gvLoadingFileTable" CssClass="commontable" runat="server">
 
    </asp:GridView>
    <script type="text/javascript">
//        function showOtherField(obj) {
//            alert(obj.title);
//        }
        $(function () {
            $(".commontable tr").each(function () {
                var self = $(this).find("td:last");
                var status = $(this).find("td:first");
                if (status.text().trim() == "Fail") {
                    status.addClass("fail");
                } else {
                    status.addClass("success");
                }
//                var text = self.text();
//                if (text.length > 10) {
//                    var obj = JSON.parse("{" + text.substr(1, text.length) + "}");
//                    self.html("<a class='result' onclick='showOtherField(this);' title='" + JSON.stringify(obj) + "'>Show Other Field</a>");
//                }
            });
        })
    </script>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Budget_LoadingFile
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
Budget_LoadingFile
</asp:Content>
